
list3 = [1, 2, 3, 4, 5]
for i in list3:
    print(i, end=' ')
# print(list3[:4])
# print(List3[1:4])
# print(list3[1:])
# print(list3[-1])
# print(list3[::2])


print(list3[:4])
print(list3[1:4])
print(list3[1:])
print(list3[-1])
print(list3[::2])
list3.append(6)
list3.extend([7,8,9])
list3.insert(0,1)
print(list3)
for i in list3:
    print(i, end=' ')


#
print()
list4 = [1, 224, 43, 44, 5242]


# list4.sort()
# print(list4)
# list4.sort(reverse=True)
# print(list4)

listnew = sorted(list4)
print(listnew)
print(list4)

# #del
# del list4
# print(list4)

#remove
list4.remove(1)
print(list4)

list4.pop()
print(list4)

list4.clear()
print(list4)

###

list5 = [48,622,4,9494,949,6626,47]
list5_new = [i for i in list5 if i%2==0]
print(list5_new)


list5_new2 = []
for i in list5:
    if i%3==0:
        list5_new2.append(i)
        print(list5_new2)



tuple1 = (1,2,3,4,5)
print(tuple1)
tuple2 = (1,)
for i in tuple1:
    print(i)
print(tuple1[0])



set1 = set([1,2,3,4,5,3,2,3,5,78,88,90])
print(set1)
set1.remove(2)
print(set1)
set1.discard(88)
print(set1)
set1.pop()
print(set1)
set1.clear()
print(set1)


dict1={'name':'zhang','age':23,'sex':'male'}
print(dict1)
print(dict1['age'])
print(dict1.get('a','404not found'))
print(type(dict1.keys()))
for i in dict1.keys():
    print(i,end=" ")


print()
dict1['id']=1010
print(dict1)
dict1.pop('id')
print(dict1)

item = dict1.popitem()
print(item)
print(type(item))
print(dict1)


list8=[1,2,3,4,5]
list9=[0,4,5,88]
print(list9+list8)


print('*'*10)
print(list9*2)
print(1 in list8)
print(4 in list8)
